#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#define ROWA 2
#define COLA 3
#define ROWB 3
#define COLB 2
#define ROWAB 2
#define COLAB 2

void matrix(int A[][COLA], int B[][COLB], int AB[][COLAB]) {
	int i, j, k;
	for (i = 0; i < ROWAB; i++) {
		for (j = 0; j < COLAB; j++) {
			for (k = 0; k < COLA; k++) {
				AB[i][j] += A[i][k] * B[k][j];
			}
		}

	}
}



int main()
{
	int A[ROWA][COLA], B[ROWB][COLB], AB[ROWAB][COLAB] = { 0 };
	printf("matrixA:\n");
	for (int i = 0; i < ROWA; i++) {
		for (int j = 0; j < COLA; j++) {
			scanf("%d", &A[i][j]);
		}
	}
	printf("matrixB:\n");
	for (int i = 0; i < ROWB; i++) {
		for (int j = 0; j < COLB; j++) {
			scanf("%d", &B[i][j]);
		}
	}
	matrix(A, B, AB);
	printf("matrixAB:\n");
	for (int i = 0; i < ROWAB; i++) {
		for (int j = 0; j < COLAB; j++) {
			if (j == 0)
				printf("%d,", AB[i][j]);
			else
				printf("%d", AB[i][j]);
		}
		printf("\n");
	}
	return 0;
}